package cn.easybuy.util;

import java.util.List;

import cn.easybuy.entity.News;
import cn.easybuy.entity.Product;
import cn.easybuy.entity.ProductCategory;
import cn.easybuy.entity.User;

public class Page {
	private int totalCount;//总记录数
	private int totalPageCount;//总页数
	private int pageSize=10;//每页显示条数
	private int currentPageNumber;//当前页号
	private List<News> newsList;//每页显示新闻集合
	private List<Product> productList; //每页显示商品集合
	private List<ProductCategory> productCategoriesList;
	public List<Product> getProductList() {
		return productList;
	}
	public void setProductList(List<Product> productList) {
		this.productList = productList;
	}
	public List<ProductCategory> getProductCategoriesList() {
		return productCategoriesList;
	}
	public void setProductCategoriesList(List<ProductCategory> productCategoriesList) {
		this.productCategoriesList = productCategoriesList;
	}
	private List<User> userList;
	public List<User> getUserList() {
		return userList;
	}
	public void setUserList(List<User> userList) {
		this.userList = userList;
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		if (totalCount>0) {
			this.totalCount = totalCount;
			totalPageCount=this.totalCount%pageSize==0 ? 
					(this.totalCount/pageSize):(this.totalCount/pageSize+1);
		}
	}
	public int getTotalPageCount() {
		return totalPageCount;
	}
	public void setTotalPageCount(int totalPageCount) {
		this.totalPageCount = totalPageCount;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		if (pageSize>0) {
			this.pageSize = pageSize;
		}
	}
	public int getCurrentPageNumber() {
		if (totalPageCount==0) {
			return 0;
		}
		return currentPageNumber;
	}
	public void setCurrentPageNumber(int currentPageNumber) {
		if (currentPageNumber>0) {
			this.currentPageNumber = currentPageNumber;
		}
	}
	public List<News> getNewsList() {
		return newsList;
	}
	public void setNewsList(List<News> newsList) {
		this.newsList = newsList;
	}
	
}
